<?php
include ("../includes/config_conexao.php");

$idCategoria = $_POST['id'];

$resposta = mysql_query( "select * from peca WHERE status_peca = 'A' and id_categoria = ".$idCategoria );

echo "<option value=''></option>";
while ( $linha = mysql_fetch_array( $resposta )) {
	$select = $ID_PECA == $linha["ID_PECA"] ? "selected" : "";
	echo "<option value=\"". $linha["ID_PECA"] . "\" $select>" . $linha["DESC_PECA"] . "</option>";
}
?>